<cfoutput>
	<CFQUERY NAME="getprod" DATASOURCE="#dsn#">
		select *
		from tblproducts
		where prodid = '#prodid#'
	</CFQUERY>
ProdID: #ProdID#
	<cfloop list="#form.fieldnames#" index="this_field">
		<cfif NOT this_field IS "new_prod_id">
			<cfif NOT evaluate("getprod."&this_field) IS evaluate("form."&this_field)>
				<CFQUERY DATASOURCE="#dsn#">
					update tblproducts
					set #this_field# = '#evaluate("form."&this_field)#'
					where prodid = '#prodid#'
				</CFQUERY>
				<cflog file="POS" text="Updated #this_field# to #evaluate("form."&this_field)#. Was #evaluate("getprod."&this_field)# for prodid #prodid#">
			</cfif>
		</cfif>
	</cfloop>
	<cfif NOT form.new_prod_id IS prodid>
		<CFQUERY DATASOURCE="#dsn#">
			update tblproducts
			set prodid = '#new_prod_id#'
			where prodid = '#prodid#'
		</CFQUERY>
		<cflog file="POS" text="Updated prodid #prodid# to #new_prod_id#">
	</cfif>
</cfoutput>
<cflocation url="editlist.cfm" addtoken="false">